import server from '../utils/server'

// axios本质就是用promise封装的ajax请求
// 请求首页轮播图数据的接口
// const getBanners = () => {
//     return new Promise((resolve, reject) => {
//         server.get('/small4/banner/list').then(res => {
//             // console.log(res);
//             resolve(res)
//         })
//     })
// }
const getBanners = async () => {
    let data = await server.get('/small4/banner/list')
    return data
}

// 请求砍价列表数据的接口
const getKjList = async () => {
    let data = await server.get('/small4/shop/goods/kanjia/list')
    return data
}

// 精选专题请求接口
const getNews = async () => {
    let data = await server.get('/small4/cms/news/list')
    return data
}

// 请求人气推荐列表数据
const getGoods = async () => {
    let data = await server.get('/small4/shop/goods/list')
    return data
}
export {
    getBanners,
    getKjList,
    getNews,
    getGoods
}